<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
  <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<div class="container">	
<div id="paperGrid"></div>
<div id="paperToolbar">

	<div>
		<a href="#" class="easyui-linkbutton" onclick="paper.toolbar.showAddDialog();" data-options="
		iconCls:'icon-add',
		plain:true">
			新增 
		</a>
		<a href="#" class="easyui-linkbutton" onclick="paper.toolbar.showUpdateDialog();" data-options="
		iconCls:'icon-edit',
		plain:true">
			修改
		</a>
		<a href="#" class="easyui-linkbutton" onclick="paper.toolbar.remove();" data-options="
		iconCls:'icon-remove',
		plain:true">
			删除
		</a>
		<a href="#" class="easyui-linkbutton" onclick="paper.toolbar.redo();" data-options="
		iconCls:'icon-redo',
		plain:true">
			取消
		</a>
	</div>
	<div>
		<strong>试卷名称：</strong>
		<input type="text" name="searchName" id="searchName"/>
		<strong>所属课程:</strong> 
			<input name="course_id" style="width:10%" class="easyui-combobox" id="papertype_choose" data-options="
			<!-- label: '所属课程：', --> 
			valueField: 'id',
  		    textField: 'name',
  		    url: '<%=request.getContextPath()%>/paper/ExamPaperServlet?command=listCourse',
			editable: false" />
		  
		<a href="#" class="easyui-linkbutton" onclick="paper.toolbar.search()" data-options="
		iconCls:'icon-search',
		plain:true">
			查询
		</a>
	</div>
		<div id="confirmState" class="easyui-window" title="提示" data-options="iconCls:'icon-save',closed:true" style="width:300px;height:150px;padding:5px;">
		<div class="easyui-layout" data-options="fit:true">
			<div data-options="region:'center'" style="padding:10px;text-align:center">
				是否修改状态？
			</div>
			<div data-options="region:'south',border:false" style="text-align:center;padding:5px 0 0;">
				<a class="easyui-linkbutton" style="padding:0 10px" data-options="iconCls:'icon-ok'" onclick="paper.confirm()"  style="width:80px">是</a>
				<a class="easyui-linkbutton" style="padding:0 10px" data-options="iconCls:'icon-cancel'" onclick="$('#confirmState').window('close')" style="width:80px">否</a>
			</div>
		</div>
	</div>
</div>
<div id="paperAddDialog" class="easyui-dialog" data-options="
title:'新增试题',
buttons:'#paperAddButtons',
closed: true,
onClose:paper.toolbar.resetAddFrom()">
<form  id="paperAddForm"  method="post" style=" padding: 10px; height:400px; width:400px" >
	       
       <div style="margin-bottom:10px">
			<input name="name" style="width:90%" class="easyui-textbox" data-options="
			label: '试卷名称：',
			required: true">
		</div>
		<!-- <div style="margin-bottom:10px">
			<input name="paper_url" style="width:90%" class="easyui-textbox" data-options="
			label: '存放地址：',
			required: true">
		</div> -->
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="paper_type" id="paperType" data-options="
			label: '试卷类型',
			panelHeight: 65,
			editable: false">
				<option value="1">平时测试</option>
				<option value="2">结业考试</option>
			</select>
		</div>
		<div style="margin-bottom:10px">
			<input name="course_id" style="width:90%" class="easyui-combobox" data-options="
			label: '所属课程：',
			valueField: 'id',
  		    textField: 'name',
  		    url: '<%=request.getContextPath()%>/paper/ExamPaperServlet?command=listCourse',
			editable: false" />
		</div>
		<div style="margin-bottom:10px">
			<input name="total_point" style="width:90%" class="easyui-textbox" data-options="
			label: '总分分数：',
			required: true">
		</div>
	    <div style="margin-bottom:10px">
			<input name="pass_point" style="width:90%" class="easyui-textbox" data-options="
			label: '通过分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="total_minutes" style="width:90%" class="easyui-textbox" data-options="
			label: '总时间：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="single_option_number" style="width:90%" class="easyui-textbox" data-options="
			label: '单选题数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="single_option_each_point" style="width:90%" class="easyui-textbox" data-options="
			label: '单选分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="single_option_difficulty" id="paperType" data-options="
			label: '单选难度',
			panelHeight: 65,
			editable: false">
				<option value="1">低</option>
   				<option value="2">中</option>
   				<option value="3">较高</option>
   				<option value="4">高</option>
			</select>
	  </div>
		<div style="margin-bottom:10px">
			<input name="multi_option_number" style="width:90%" class="easyui-textbox" data-options="
			label: ' 多选题数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="multi_option_each_point" style="width:90%" class="easyui-textbox" data-options="
			label: ' 多选分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="multi_option_difficulty" id="paperType" data-options="
			label: '多选难度',
			panelHeight: 65,
			editable: false">
				<option value="1">低</option>
   				<option value="2">中</option>
   				<option value="3">较高</option>
   				<option value="4">高</option>
			</select>
	    </div>
		<div style="margin-bottom:10px">
			<input name="judge_number" style="width:90%" class="easyui-textbox" data-options="
			label: ' 判断题数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="judge_each_point" style="width:90%" class="easyui-textbox" data-options="
			label: ' 判断分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="judge_difficulty" id="judge_difficulty" data-options="
			label: '判断难度',
			panelHeight: 65,
			editable: false">
				<option value="1">低</option>
   				<option value="2">中</option>
   				<option value="3">较高</option>
   				<option value="4">高</option>
			</select>
	    </div>
	   <!--  <div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="state" id="state" data-options="
			label: '试卷状态',
			panelHeight: 65,
			editable: false">
				<option value="1">有效</option>
   				<option value="2">无效</option>
			</select>
	    </div> -->
		<div style="margin-bottom:10px">
			<input name="memo" style="width:90%" class="easyui-textbox" data-options="
			label: ' 备注：',
			required: true">
		</div>
</form>
</div>
<div id="paperAddButtons">
	<a href="#" onclick="paper.toolbar.add()" class="easyui-linkbutton" data-options="
	iconCls: 'icon-add',
	plain: true">
		新增
	</a>
	<a href="#" onclick="paper.toolbar.hiddenAddDialog();" class="easyui-linkbutton" data-options="
	iconCls: 'icon-redo',
	plain: true">
		取消
	</a>
</div>

<div id="paperUpdateDialog" class="easyui-dialog" data-options="
title: '修改试题信息',
buttons: '#paperUpdateButtons',
closed: true,
onClose: paper.toolbar.resetUpdateFrom">
	<form id="paperUpdateForm" method="post" style="padding: 20px; height:400px; width:400px">
		<input type="hidden" name="id"/>
		<div style="margin-bottom:10px">
			<input name="name" style="width:90%" class="easyui-textbox" data-options="
			label: '试卷名称：',
			required: true">
		</div>
		<!-- <div style="margin-bottom:10px">
			<input name="paper_url" style="width:90%" class="easyui-textbox" data-options="
			label: ' 存放地址：',
			required: true">
		</div> -->
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="paper_type" id="paper_type" data-options="
			label: '试卷类型',
			panelHeight: 65,
			editable: false">
				<option value="1">平时测试</option>
				<option value="2">结业考试</option>
			</select>
		</div>
		<div style="margin-bottom:10px">
			<input name="course_id" style="width:90%" class="easyui-combobox" data-options="
			label: '所属课程：',
			valueField: 'id',
  				 textField: 'name',
  				 url: '<%=request.getContextPath()%>/paper/ExamPaperServlet?command=listCourse',
			editable: false"/>
		</div>
		<div style="margin-bottom:10px">
			<input name="total_point" style="width:90%" class="easyui-textbox" data-options="
			label: '总分分数：',
			required: true">
		</div>
	    <div style="margin-bottom:10px">
			<input name="pass_point" style="width:90%" class="easyui-textbox" data-options="
			label: '通过分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="total_minutes" style="width:90%" class="easyui-textbox" data-options="
			label: '总时间：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="single_option_number" style="width:90%" class="easyui-textbox" data-options="
			label: '单选题数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="single_option_each_point" style="width:90%" class="easyui-textbox" data-options="
			label: '单选分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="single_option_difficulty" data-options="
			label: '单选难度',
			panelHeight: 65,
			editable: false">
				<option value="1">低</option>
   				<option value="2">中</option>
   				<option value="3">较高</option>
   				<option value="4">高</option>
			</select>
	  </div>
		<div style="margin-bottom:10px">
			<input name="multi_option_number" style="width:90%" class="easyui-textbox" data-options="
			label: ' 多选题数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="multi_option_each_point" style="width:90%" class="easyui-textbox" data-options="
			label: ' 多选分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="multi_option_difficulty" id="multi_option_difficulty" data-options="
			label: '多选难度',
			panelHeight: 65,
			editable: false">
				<option value="1">低</option>
   				<option value="2">中</option>
   				<option value="3">较高</option>
   				<option value="4">高</option>
			</select>
	    </div>
		<div style="margin-bottom:10px">
			<input name="judge_number" style="width:90%" class="easyui-textbox" data-options="
			label: ' 判断题数：',
			required: true">
		</div>
		<div style="margin-bottom:10px">
			<input name="judge_each_point" style="width:90%" class="easyui-textbox" data-options="
			label: ' 判断分数：',
			required: true">
		</div>
		<div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="judge_difficulty" id="judge_difficulty" data-options="
			label: '判断难度',
			panelHeight: 65,
			editable: false">
				<option value="1">低</option>
   				<option value="2">中</option>
   				<option value="3">较高</option>
   				<option value="4">高</option>
			</select>
	  </div>
	 <!--  <div style="margin-bottom:10px;margin-top:10px">
			<select class="easyui-combobox"style="width:90%"  name="state" id="state" data-options="
			label: '试卷状态',
			panelHeight: 65,
			editable: false">
				<option value="1">有效</option>
   				<option value="2">无效</option>
			</select>
	  </div> -->
		<div style="margin-bottom:10px">
			<input name="memo" style="width:90%" class="easyui-textbox" data-options="
			label: ' 备注：',
			required: true">
		</div>
	</form>
</div>
<div id="paperUpdateButtons">
	<a href="#" onclick="paper.toolbar.update()" class="easyui-linkbutton" data-options="
	iconCls: 'icon-edit',
	plain: true">
		修改
	</a>
	<a href="#" onclick="paper.toolbar.hiddenUpdateDialog();" class="easyui-linkbutton" data-options="
	iconCls: 'icon-redo',
	plain: true">
		取消
	</a>
		<div id="paperPreViewDialog" class="easyui-window" style="width:600px;height:400px" data-options="
			title:'试卷预览',
			buttons:'#paperPreViewButtons',
			closed: true">
			<table id="paperPreViewTable" style="width:100%;height:90%"></table>
		</div>
    </div>
 </div>
<script>
	var paper = {
		init : function() {
			paper.paperGrid = $('#paperGrid');
			paper.menu = $('#menu');
			paper.paperAddDialog = $('#paperAddDialog');
			paper.paperAddForm = $('#paperAddForm');
			paper.paperUpdateForm = $('#paperUpdateForm');
			paper.menuUpdate = $('#menuUpdate');
			paper.paperUpdateDialog = $('#paperUpdateDialog');
			paper.paperPreViewDialog = $('#paperPreViewDialog');
			paper.paperPreviewTable = $('#paperPreviewTable');
			paper.paperGrid.datagrid({
			    url: '<%=request.getContextPath()%>/paper/ExamPaperServlet?command=listPaper',
			    fitColumns: true,
			    striped: true,
			    rownumbers: true,
			    pagination: true,
			    pageSize: 20,
			    pageList: [10, 20, 30, 40, 50],
			    pageNumber: 1,
			    sortName: 'totalPoint',
			    sortOrder: 'desc',
			    toolbar: '#paperToolbar',
			    columns:[[
					{field:'id', width:100, checkbox: true},
					{field:'name', title:'试卷名称', width:100, align:'center'},
					{field:'sys_course__name', title:'所属课程', width:100, align:'center'},
					{field:'totalPoint', title:'总分分数', width:100, align:'center'},
			    	{field:'passPoint', title:'通过分数', width:100, align:'center'},
					{field:'stateStr', title:'状态', width: 100, formatter: paper.open, align:'center'},
				 	{field:'operation',title:'操作',width:100,align:'center',
						formatter: function(value,row,index){
		      				var rowStr = escape(JSON.stringify(row));
				      		return '<a href="#" onclick="paper.showPreViewDialog(\''+ rowStr +'\');">'+'试卷预览'+'</a>'
				     	} 
					}	
			    ]],
				onDblClickRow: function(rowIndex, rowData) {
					paper.toolbar.showUpdateDialog(rowData.id);
				}
			});
		},
		open:function(rowIndex,rowData){
			return '<a href=#; onclick=paper.show(' + rowData.id + ','+ rowData.state +')>' + rowIndex + '</a>';
		},
		//修改状态
		show:function (id,state){
			paper.paperId = id;
			paper.paperState = state;
			$('#confirmState').window('open');
		},
		confirm:function(){
			$.post('<%=request.getContextPath()%>/paper/ExamPaperServlet?command=changeState',{"paper_id" : paper.paperId,"paper_state" : paper.paperState}, function(data){
				paper.paperGrid.datagrid('reload');
			});
			$('#confirmState').window('close');
		},
		//试卷预览
		showPreViewDialog:function(rowStr){
		//	paper.toolbar.showCombotree();
			paper.paperPreViewDialog.dialog('open');
			//jQuery.parseJSON 解析json
			 var rowJson = jQuery.parseJSON(unescape(rowStr));
			$.post(
					'<%=request.getContextPath()%>/paper/ExamPaperServlet?command=preview',
					{"paperUrl":rowJson.paperUrl},					
					function(data){
					console.log(data);
					var table = paper.paperPreViewTable;
					$("table").empty()
					var singleQuestionEntitys = data.singleQuestionEntities;
					$("table").append("<p>试卷名称："+data.name+"</p>"+
								 "<p>试卷类型："+data.paperTypeStr+"</p>");
					
					for (var i = 0;i<singleQuestionEntitys.length;i++) {
						if(i == 0){
							$("table").append("<tr>" +
									"<td style=\"font-weight:bold\">" +
									"(一)、单项选择题（每题" + data.singleOptionEachPoint +"分，共"+singleQuestionEntitys.length+"题,总分："+
									data.singleOptionEachPoint*singleQuestionEntitys.length+"分）</br>"+
									"</td>" +
								 "</tr>" + 
								 "</br>");
						}
						$("table").append("<tr>" +
										"<td>" +
										"　　("+(i+1)+")、" + singleQuestionEntitys[i].question +"</br>"+
										"　　　　A. " + singleQuestionEntitys[i].answerA + "</br>"+
										"　　　　B. " + singleQuestionEntitys[i].answerB + "</br>"+
										"　　　　C. " + singleQuestionEntitys[i].answerC + "</br>"+
										"　　　　D. " + singleQuestionEntitys[i].answerD + "</br>"+
										"</td>" +
									 "</tr>" + 
									 "</br>");
					}
					var multiQquestionEntities = data.multiQquestionEntities;
					for (var i = 0;i<multiQquestionEntities.length;i++) {
						if(i == 0){
							$("table").append("<tr>" +
									"<td style=\"font-weight:bold\">" +
									"(二)、单项选择题（每题" + data.multiOptionEachPoint +"分，共"+multiQquestionEntities.length+"题，总分："+
									data.multiOptionEachPoint*multiQquestionEntities.length+"分）</br>"+
									"</td>" +
								 "</tr>" + 
								 "</br>");
						}
						$("table").append("<tr>" +
										"<td>" +
										"　　("+(i+1)+")、" + multiQquestionEntities[i].question +"</br>"+
										"　　　　A. " + multiQquestionEntities[i].answerA + "</br>"+
										"　　　　B. " + multiQquestionEntities[i].answerB + "</br>"+
										"　　　　C. " + multiQquestionEntities[i].answerC + "</br>"+
										"　　　　D. " + multiQquestionEntities[i].answerD + "</br>"+
										"</td>" +
									 "</tr>" + 
									 "</br>");
					}
					var judgeQquestionEntities = data.judgeQquestionEntities;
					for (var i = 0;i<judgeQquestionEntities.length;i++) {
						if(i == 0){
							$("table").append("<tr>" +
									"<td style=\"font-weight:bold\">" +
									"(二)、判断题（每题" + data.judgeEachPoint +"分，共"+judgeQquestionEntities.length+"题，总分："+
									data.judgeEachPoint*judgeQquestionEntities.length+"分）</br>"+
									"</td>" +
								 "</tr>" + 
								 "</br>");
						}
						$("table").append("<tr>" +
										"<td>" +
										"　　("+(i+1)+")、" + judgeQquestionEntities[i].question +"</br>"+
										"</td>" +
									 "</tr>" + 
									 "</br>");
					}
				},
				"json"
			);
			paper.paperGrid.datagrid('reload');
		},
		toolbar: {
			
			showCombotree: function() {
				paper.menu.combotree({
					lines: true,
					multiple: true,
					checkbox: true,
					onlyLeafCheck: true,
					onLoadSuccess: function(node, data) {
						$(this).tree('expandAll')
					}
				});
			},
			showAddDialog: function() {
				paper.toolbar.showCombotree();
				paper.paperAddDialog.dialog('open');
			
		
			},
			hiddenAddDialog: function() {
				paper.paperAddDialog.dialog('close');
				paper.toolbar.resetAddForm();
			},
			resetAddForm: function() {
				paper.paperAddForm.form('reset');
			},
			search:function(){
				var searchName = $("#searchName").val();
				var papertype_choose = $('#papertype_choose').combobox('getValue');
				paper.paperGrid.datagrid({
					url: '<%=request.getContextPath() %>/paper/ExamPaperServlet?command=search',
					queryParams:{
						"searchName": searchName,
						"papertype_choose" : papertype_choose}, 
						//toolbar:'#tb',	
						fitColumns: true,
					    striped: true,
					    rownumbers: true,
					    pagination: true,
					    pageSize: 20,
					    pageList: [10, 20, 30, 40, 50],
					    pageNumber: 1,
					    sortName: 'totalPoint',
					    sortOrder: 'desc',
					    toolbar: '#paperToolbar',
					    columns:[[
							{field:'id', width:100, checkbox: true},
							{field:'name', title:'试卷名称', width:100, align:'center'},
							{field:'sys_course__name', title:'所属课程', width:100, align:'center'},
							{field:'totalPoint', title:'总分分数', width:100, align:'center'},
					    	{field:'passPoint', title:'通过分数', width:100, align:'center'},
							{field:'stateStr', title:'状态', width: 100, formatter: paper.open, align:'center'},
							
					    ]],
						onDblClickRow: function(rowIndex, rowData) {
							paper.toolbar.showUpdateDialog(rowData.id);
						}	
				})
			},
			add: function() {
				if (paper.paperAddForm.form('validate')) {
					$.messager.progress({
						text : '正在处理...'
					});
					$.post('<%=request.getContextPath()%>/paper/ExamPaperServlet?command=addPaper', paper.paperAddForm.serialize(), function(data) {
						if (data) {
							$.messager.progress('close');
						    paper.toolbar.hiddenAddDialog();
							paper.paperGrid.datagrid('reload');
							$.messager.show({
								title: '系统提示',
								msg: '新增成功！',
								timeout: 3000,
								showType: 'slide'
							});
							paper.toolbar.resetAddFrom();
						} else {
							$.messager.alert('系统提示', '新增失败！', 'error')
						}
					
					});
				}
			},
			resetAddFrom:function(){
				$('resetAddFrom').form('reset');
			},
			
			showUpdateDialog: function(id) {
				paper.toolbar.showCombotree();
				var getData = function(v) {
					$.messager.progress({
						text : '正在处理...'
					});
					$.post('<%=request.getContextPath()%>/paper/ExamPaperServlet?command=getPaper', {id : v}, function(data) {
						//console.log(data)
						if (data) {
							paper.paperUpdateForm.form('load', {
								id: data.id,
								name: data.name,
								paper_url: data.paperUrl,
								paper_type: data.paperType,
								course_id: data.courseId,
								total_point: data.totalPoint,
								pass_point: data.passPoint,
								total_minutes: data.totalMinutes,
								single_option_number: data.singleOptionNumber,
								single_option_each_point: data.singleOptionEachPoint,
								single_option_difficulty: data.singleOptionDifficulty,
								multi_option_number: data.multiOptionNumber,
								multi_option_each_point: data.multiOptionEachPoint,
								multi_option_difficulty: data.multiOptionDifficulty,
								judge_number: data.judgeNumber,
								judge_each_point: data.judgeEachPoint,
								judge_difficulty: data.judgeDifficulty,
								state:data.state,
								memo:data.memo
							});
							$('#paperUpdateDialog').dialog('open');
						} else {
							$.messager.alert('系统提示', '获取信息失败！', 'error')
						}
						$.messager.progress('close');
					}, 'json');
				}
				if (id) {
					getData(id);
				} else {
					var row = paper.paperGrid.datagrid('getSelections');
					if (row.length == 1) {
						getData(row[0].id);
					} else {
						$.messager.show({
							title: '系统提示',
							msg: '请选择一行数据进行修改！',
							timeout: 3000,
							showType: 'slide'
						});	
					}
				}
			},
			hiddenUpdateDialog: function() {
				$('#paperUpdateDialog').dialog('close');
				paper.toolbar.resetUpdateFrom();
			},
			resetUpdateFrom: function() {
				paper.paperUpdateForm.form('reset');
			},
			update: function() {
				if (paper.paperUpdateForm.form('validate')) {
					$.messager.progress({
						text : '正在处理...'
					});
					$.post('<%=request.getContextPath()%>/paper/ExamPaperServlet?command=updatePaper', $("#paperUpdateForm").serialize(), function(data) {
						if (data == 1) {
							$.messager.show({
								title: '系统提示',
								msg: '修改成功！',
								timeout: 3000,
								showType: 'slide'
							});
							paper.paperGrid.datagrid('reload');
						} else {
							$.messager.alert('系统提示', '修改失败！', 'error');
						}
						$.messager.progress('close');
						paper.toolbar.hiddenUpdateDialog();
					});
				}
			},
			remove: function() {
				var row = paper.paperGrid.datagrid('getSelections');
				if (row.length > 0) {
					var ids = [];
					$.each(row, function(i, v) {
						ids.push(v.id);
					});
					$.post('<%=request.getContextPath()%>/paper/ExamPaperServlet?command=deletePaper', {ids: ids.join(',')}, function(data) {
						if (data == 1) {
							$.messager.show({
								title: '系统提示',
								msg: '删除成功！',
								timeout: 3000,
								showType: 'slide'
							});
							paper.paperGrid.datagrid('reload');
						} else {
							$.messager.alert('系统提示', '删除失败！', 'error')
						}
						$.messager.progress('close');
					});
				} else {
					$.messager.show({
						title: '系统提示',
						msg: '请选择数据进行删除！',
						timeout: 3000,
						showType: 'slide'
					});	
				}
			},
			redo: function() {
				paper.paperGrid.datagrid('unselectAll');
			},	
		}
	};
	
	$(function(){
		paper.init();
	});
</script>
